package cn.dida.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.dida.dao.DeliveryInfoDao;
import cn.dida.model.DeliveryInfo;
import cn.dida.service.DeliverInfoService;
/**
 * 物流配送信息  接口实现类
 * @author lisha
 * @date 2016-11-21 11:10
 * */
@Service
public class DeliverInfoServiceImpl implements DeliverInfoService {

	@Autowired
	private DeliveryInfoDao infoDao;
	@Transactional	
	@Override
	public Boolean insertDeliverInfo(DeliveryInfo info) {
		// TODO Auto-generated method stub
		infoDao.updatePrizeStock(info.getPzid(), -1, 0, 1);
		return infoDao.insert(info) == 1;
	}
	@Transactional
	@Override
	public Boolean updateDeliverInfo(DeliveryInfo info) {
		// TODO Auto-generated method stub
		return infoDao.update(info) == 1;
	}

	@Override
	public DeliveryInfo getDeliverInfoById(Integer winid) {
		// TODO Auto-generated method stub
		return infoDao.getInfoByWinid(winid);
	}

	

}
